{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# https://medium.com/swlh/playing-with-word-vectors-308ab2faa519\n",
    "# https://github.com/makcedward/nlp/blob/master/sample/nlp-word_embedding.ipynb"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "ss1 = 'The president greets the press in Chicago'\n",
    "ss2 = 'Obama speaks to the media in Illinois'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Count Vectorizer method"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "def cosine_distance_countvectorizer_method(s1, s2):\n",
    "    \n",
    "    # sentences to list\n",
    "    allsentences = [s1 , s2]\n",
    "    \n",
    "    # packages\n",
    "    from sklearn.feature_extraction.text import CountVectorizer\n",
    "    from scipy.spatial import distance\n",
    "    \n",
    "    # text to vector\n",
    "    vectorizer = CountVectorizer()\n",
    "    all_sentences_to_vector = vectorizer.fit_transform(allsentences)\n",
    "    text_to_vector_v1 = all_sentences_to_vector.toarray()[0].tolist()\n",
    "    text_to_vector_v2 = all_sentences_to_vector.toarray()[1].tolist()\n",
    "    \n",
    "    # distance of similarity\n",
    "    cosine = distance.cosine(text_to_vector_v1, text_to_vector_v2)\n",
    "    print('Similarity of two sentences are equal to ',round((1-cosine)*100,2),'%')\n",
    "    return cosine"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Similarity of two sentences are equal to  37.8 %\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "0.6220355269907728"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cosine_distance_countvectorizer_method(ss1 , ss2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Glove Embedding"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "gloveFile = \"data\\\\glove.6B.50d.txt\"\n",
    "import numpy as np\n",
    "def loadGloveModel(gloveFile):\n",
    "    print (\"Loading Glove Model\")\n",
    "    with open(gloveFile, encoding=\"utf8\" ) as f:\n",
    "        content = f.readlines()\n",
    "    model = {}\n",
    "    for line in content:\n",
    "        splitLine = line.split()\n",
    "        word = splitLine[0]\n",
    "        embedding = np.array([float(val) for val in splitLine[1:]])\n",
    "        model[word] = embedding\n",
    "    print (\"Done.\",len(model),\" words loaded!\")\n",
    "    return model\n",
    "\n",
    "import re\n",
    "from nltk.corpus import stopwords\n",
    "import pandas as pd\n",
    "\n",
    "def preprocess(raw_text):\n",
    "\n",
    "    # keep only words\n",
    "    letters_only_text = re.sub(\"[^a-zA-Z]\", \" \", raw_text)\n",
    "\n",
    "    # convert to lower case and split \n",
    "    words = letters_only_text.lower().split()\n",
    "\n",
    "    # remove stopwords\n",
    "    stopword_set = set(stopwords.words(\"english\"))\n",
    "    cleaned_words = list(set([w for w in words if w not in stopword_set]))\n",
    "\n",
    "    return cleaned_words\n",
    "\n",
    "def cosine_distance_between_two_words(word1, word2):\n",
    "    import scipy\n",
    "    return (1- scipy.spatial.distance.cosine(model[word1], model[word2]))\n",
    "\n",
    "def calculate_heat_matrix_for_two_sentences(s1,s2):\n",
    "    s1 = preprocess(s1)\n",
    "    s2 = preprocess(s2)\n",
    "    result_list = [[cosine_distance_between_two_words(word1, word2) for word2 in s2] for word1 in s1]\n",
    "    result_df = pd.DataFrame(result_list)\n",
    "    result_df.columns = s2\n",
    "    result_df.index = s1\n",
    "    return result_df\n",
    "\n",
    "def cosine_distance_wordembedding_method(s1, s2):\n",
    "    import scipy\n",
    "    vector_1 = np.mean([model[word] for word in preprocess(s1)],axis=0)\n",
    "    vector_2 = np.mean([model[word] for word in preprocess(s2)],axis=0)\n",
    "    cosine = scipy.spatial.distance.cosine(vector_1, vector_2)\n",
    "    print('Word Embedding method with a cosine distance asses that our two sentences are similar to',round((1-cosine)*100,2),'%')\n",
    "\n",
    "def heat_map_matrix_between_two_sentences(s1,s2):\n",
    "    df = calculate_heat_matrix_for_two_sentences(s1,s2)\n",
    "    import seaborn as sns\n",
    "    import matplotlib.pyplot as plt\n",
    "    fig, ax = plt.subplots(figsize=(5,5)) \n",
    "    ax_blue = sns.heatmap(df, cmap=\"YlGnBu\")\n",
    "    # ax_red = sns.heatmap(df)\n",
    "    print(cosine_distance_wordembedding_method(s1, s2))\n",
    "    return ax_blue"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Loading Glove Model\n",
      "Done. 400000  words loaded!\n",
      "Word Embedding method with a cosine distance asses that our two sentences are similar to 81.25 %\n",
      "None\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x1a66016b5c0>"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAATEAAAEyCAYAAACS8efGAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAGdhJREFUeJzt3Xu8HWV97/HPdycikHAVbRGC3OEFiigxyKWKGi1KgRIoV493IhUKajkVxENbqLZilb5Q1BMpghcuAoo5aRQ9CA1FIRchF0KjaVATsHq4XwuE/M4f82xYazU7e7LIs2c/s79vXvNaM7NmzfxWsvLj9zzzzIwiAjOzUg00HYCZ2YvhJGZmRXMSM7OiOYmZWdGcxMysaE5iZlY0JzEzK5qTmJkVzUnMzIo2PvcBdjnxylZfErDtcZOaDiGblf/+dNMhZDXuqjuaDiGrFXecqX4+t8kOJ/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akO6l+FBtT/WN4E/AtgIhYBCwaYv+nq3oA8G3AJCBrlfIiXR8RayJiKVXCAjgYuDIinouI3wH/Cryh53M/Az4p6RPAqyLiqcxxLgampsrrjyLikbT+yo7XA9L8VOBL6e9vJrC5pM2oEt81qZq8ENi7Y/9vAT4BHBYRD6V1twKXSTqZKqHndDDwvYh4IiIeB74L/BGwMiIGn8P6rbQdwFsk3a7q0YZv7fkug90Fi4G7IuK3EfE0sILq9whl/UYbM5r7xJ7umF/TsbyGKu7ngKMjYlnnh1LFvs7Bb5IOofpHdEBEPCnpZqokOFp1/lmo53VIEXGFpNuBw4AbJH0oIn6SI8B0vF9I2g94F/D3kn40+FbnZul1gOrPvyuxSvoicFNEHCVpR6r/QQ1aAewM7A7MT8c8RdXDnA8D7pS0b0Q8sEG/WEd4Q6zv/b2FpI2BL1O1AlZK+hu6f2Odv+fe3/r4An+jjRnNldhwbgD+oqOf4XVp/RzgpLTu1VRNyl5bAA+lH8eewBvXss1oNwc4TtI4SS+nqkDndm4gaWdgRURcRPV//qwPOZb0SuDJiPgW8I/A69Nbx3W8/izN/wg4reOz+6bZLYB70/z7eg7xa2Aa8A1Je6fP7RIRt0fEucD9vFDF5DAH+FNJm0qawAtN2x0kDVaYJwD/xgsJ535JE1n/ky1t+I2OiJKT2PnAS4BFqelxflr/FWCipEXAX9HzDzv5IdX/7Ralz902AvFuaN+jaiovBH4C/FVE/GfPNscBS1KTbU/gG5ljeg0wNx3vHGCwk/qlqSI8A/hYWnc6MDl1hi8FTknrL6Cq4m5lLc3DVHmfRNXk3AX4XDqxsYQqySzM9N2IiJ9T9VHOBW4HLgEeAu4G3pt+T1sDX4mIh4GvUTUXrwfmrefh2vAbHRG+7MiykvQrqibV/U3HYu1UciVmZuZKzMzK5krMzIrmJGZmRXMSM7OiOYmZWdGcxMysaP8fAq8W1m+kFPUAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 360x360 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "ss1 = 'The president greets the press in Chicago'\n",
    "ss2 = 'Obama speaks to the media in Illinois'\n",
    "\n",
    "model = loadGloveModel(gloveFile)\n",
    "heat_map_matrix_between_two_sentences(ss1,ss2)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
